﻿using System.Web.Mvc;
using MyAMS.WebServer.Models;
using MyAMS.WebServer.Services;
using MyAMS.WebServer.ViewModels;

namespace MyAMS.WebServer.Controllers
{
    /// <summary>
    /// 节点控制器
    /// </summary>
    public class NodeController : Controller
    {
        private readonly INodeService nodeService;

        /// <summary>
        /// 初始化一个新的 <see cref="NodeController"/> 类的实例
        /// </summary>
        /// <param name="nodeService">节点服务</param>
        public NodeController(INodeService nodeService)
        {
            this.nodeService = nodeService;
        }

        /// <summary>
        /// 显示一个数据的详细信息
        /// </summary>
        /// <returns></returns>
        public ViewModelItem<Node> Details(Node Node)
        {
            return new ViewModelItem<Node>
            {
                Item = Node,
                Container = Node.Parent
            };
        }        
        
        /// <summary>
        /// Robots.txt
        /// </summary>
        /// <returns></returns>
        public ActionResult Robots()
        {
            return View();
        }
    }
}
